﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace TextDataExtractor.DEML {
	public class RemoveHtmlTagFilter : DemlElement, IDataFilter {
		
		public static Regex HTML_TAG = new Regex(@"<[^>]*>", RegexOptions.Multiline);

		public object applyFilter(ExecutionContext context, object input) {
			if (input is string) {
				input = HTML_TAG.Replace((string)input, "");
			}
			return input;
		}

	}

	public class RemoveNewLineChar : DemlElement, IDataFilter {

		public object applyFilter(ExecutionContext context, object input) {
			if (input is string) {
				return Regex.Replace((string)input, "\n", "");
			}
			return input;
		}

	}
}
